//
//  ZHSheetView.h
//  sc-cyan-ios
//
//  Created by lj on 2017/12/27.
//  Copyright © 2017年 greenbuilding. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class ZHSheetView;
@protocol ZHSheetViewDataSource <NSObject>
@required
//返回表格有多少行
- (NSInteger)sheetView:(ZHSheetView *)sheetView numberOfRowsInSection:(NSInteger)section;
//返回表格有多少列
- (NSInteger)sheetView:(ZHSheetView *)sheetView numberOfColsInSection:(NSInteger)section;
////返回表格某行某列位置上需要显示的内容
//- (NSString *)sheetView:(SheetView *)sheetView cellForContentItemAtIndexRow:(NSIndexPath *)indexRow indexCol:(NSIndexPath *)indexCol;
//返回表格某行某列需要显示的视图
- (UIView *)sheetView:(ZHSheetView *)sheetView cellForContentItemAtIndexRow:(NSIndexPath *)indexRow indexCol:(NSIndexPath *)indexCol rect:(CGRect)rect;
//返回表格左侧标题列每行需要显示的内容
- (NSString *)sheetView:(ZHSheetView *)sheetView cellForLeftColAtIndexPath:(NSIndexPath*)indexPath;
//返回表格上边标题行每列需要显示的内容
- (NSString *)sheetView:(ZHSheetView *)sheetView cellForTopRowAtIndexPath:(NSIndexPath*)indexPath;

@optional
//返回表格某行是否需要填充颜色
- (BOOL)sheetView:(ZHSheetView *)sheetView cellWithColorAtIndexRow:(NSIndexPath *)indexRow;

@end

@protocol ZHSheetViewDelegate <NSObject>

//删除列
- (void)sheetView:(ZHSheetView *)sheetView cellWithDidDeleteAtIndexRow:(NSIndexPath *)indexPath;
@required
//返回表格每行的高度
- (CGFloat)sheetView:(ZHSheetView *)sheetView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
//返回表格每列的宽度
- (CGFloat)sheetView:(ZHSheetView *)sheetView widthForColAtIndexPath:(NSIndexPath *)indexPath;

- (void)sheetView:(ZHSheetView *)sheetView didSelectItemAtIndexRow:(NSIndexPath *)indexRow indexCol:(NSIndexPath *)indexCol;
@end

@interface ZHSheetView : UIView

@property (nonatomic, strong) id<ZHSheetViewDataSource> dataSource;
@property (nonatomic, strong) id<ZHSheetViewDelegate> delegate;
//第一行第一列格子要显示的内容
@property (nonatomic, strong) NSString *sheetHead;
//左侧标题列宽度（必须设置）
@property (nonatomic, assign) CGFloat titleColWidth;
//上边标题行高度（必须设置）
@property (nonatomic, assign) CGFloat titleRowHeight;
//线条颜色
@property (nonatomic, retain) UIColor *lineColor;
//表格刷新
- (void)reloadData;

@end


